
import Relay from "react-relay";

export  class EnBalanceDetail extends Relay.Mutation {

    getMutation() {
        return Relay.QL`mutation { enBalanceDetail }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId:this.props.orderId
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on enBalanceDetailPayload {
                data {
                    errorCode
                    enterpriseBalance{
                        invoiceNum
                        expressName
                        expressSheet
                        invoiceFileJson
                        
                        balanceMoney
                        repayMoney
                        remitFileJson
                        
                        balanceExamineLogList{
                            orderId
                            createTime
                            createId
                            createBy
                            examineStatus
                            examineLogId
                            examineDesc
                            failReason
                        }
                    }
                }
        }`
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on enBalanceDetailPayload {
                      data {
                        errorCode
                        enterpriseBalance{
                            invoiceNum
                            expressName
                            expressSheet
                            invoiceFileJson
                            
                            balanceMoney
                            repayMoney
                            remitFileJson
                            
                            balanceExamineLogList{
                                orderId
                                createTime
                                createId
                                createBy
                                examineStatus
                                examineLogId
                                examineDesc
                                failReason
                            }
                        }
                    }
                 }
            `]
        }];
    }

}

export class ExamineEnBalance extends Relay.Mutation{
    getMutation() {
        return Relay.QL`mutation { examineEnBalance }`;
    }

    getVariables() {
        return {
            argsInput: {
                orderId:this.props.orderId,
                status:this.props.status,
                invoiceExamine:this.props.invoiceExamine,
                createId:this.props.createId,
                createBy:this.props.createBy
            }
        };
    };

    getFatQuery() {
        return Relay.QL`fragment on examineEnBalancePayload {
            data {
               errorCode
               value
            }
        }`
    }


    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on examineEnBalancePayload {
                      data {
                        errorCode
                        value
                     }
                 }
            `]
        }];
    }
}